using System;
using System.Collections.Generic;
using System.Web.Configuration;
using System.Web.Security;

public partial class Login : System.Web.UI.Page
{
	protected void Page_Load(object sender, System.EventArgs e)
	{
		if (!Page.IsPostBack)
			txtUsername.Focus();
	}

	protected void btnSubmit_Click(object sender, System.EventArgs e)
	{
		if (Page.IsValid)
		{
			if (FormsAuthentication.Authenticate(txtUsername.Text, txtPassword.Text))
				FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, false);
			else
			{
				lblError.Text = "Invalid User Name or Password. Please try again.";
				txtUsername.Focus();
			}
		}
	}
}
